#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：hiflyworks_web_tests 
@File    ：dh_service.py.py
@Author  ：beibei
@Date    ：2025/6/20 7:12 PM 
'''
from pages.digital_human_page import DigitalHumanPage
from utils.upload_image import choose_random_image
from utils.screenshot.step_screenshot import step_screenshot
from utils.report import attach_image


def create_digital_human_3(page, request):
    dh = DigitalHumanPage(page)

    dh.go_to_avatar_pic_page()

    img = choose_random_image()
    dh.upload_avatar(str(img))
    attach_image(request, step_screenshot(page, "step_upload_avatar"))

    dh.select_video_model_3()
    attach_image(request, step_screenshot(page, "step_select_model"))

    dh.submit_create()
    attach_image(request, step_screenshot(page, "step_submit_success"))


def create_digital_human_2(page, request):
    dh = DigitalHumanPage(page)

    dh.go_to_avatar_pic_page()

    img = choose_random_image()
    dh.upload_avatar(str(img))
    attach_image(request, step_screenshot(page, "step_upload_avatar"))

    dh.select_video_model_2()
    attach_image(request, step_screenshot(page, "step_select_model"))

    dh.submit_create()
    attach_image(request, step_screenshot(page, "step_submit_success"))
